package com.guochenglang.www.dao;

import com.guochenglang.www.pojo.CommentMessage;

import java.sql.SQLException;
import java.util.ArrayList;

/**
 * @author GuoChenglang
 */
public interface CommentMessageDao {
    /**
     * 搜索他人给你的评论信息
     *
     * @param conditions 他人评论信息条件
     * @return 评论信息列表
     * @throws SQLException           sql异常
     * @throws InterruptedException   断点异常
     * @throws IllegalAccessException 非法访问异常
     * @throws InstantiationException 实现异常
     */
    ArrayList<CommentMessage> commentMessageSelect(CommentMessage conditions) throws SQLException, InterruptedException, IllegalAccessException, InstantiationException;

    /**
     * 添加他人对你的评论信息
     *
     * @param comfort 评论信息
     * @return 评论信息的主键
     * @throws SQLException           sql异常
     * @throws InterruptedException   断点异常
     * @throws IllegalAccessException 非法访问异常
     */
    int insertCommentMessage(CommentMessage comfort) throws SQLException, InterruptedException, IllegalAccessException;

    /**
     * 删除他人评论信息
     *
     * @param conditions 删除条件
     * @return 删除行数
     * @throws SQLException           sql异常
     * @throws InterruptedException   断点异常
     * @throws IllegalAccessException 非法访问异常
     */
    int deleteCommentMessage(CommentMessage conditions) throws SQLException, InterruptedException, IllegalAccessException;

    /**
     * 更新他人评论信息
     *
     * @param set        更新的数据
     * @param conditions 更新的条件
     * @return 更新行数
     * @throws SQLException           sql异常
     * @throws InterruptedException   断点异常
     * @throws IllegalAccessException 非法访问异常
     */
    int updateMessage(CommentMessage set, CommentMessage conditions) throws SQLException, InterruptedException, IllegalAccessException;
}
